package com.pactera.asmp.server.restfullapi;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.pactera.asmp.server.entity.ResponseResult;
import com.pactera.asmp.server.service.ICenterLargeScreenService;

@RestController
@RequestMapping("/api/v1/screen")
public class RestfulCenterLargeScreenApi {

    @Autowired
    private ICenterLargeScreenService centerLargeScreenService;

    @PostMapping(value = "/task/{projectId}", produces = "application/json;charset=UTF-8")
    public ResponseResult getTaskStatisticsData(@PathVariable("projectId") Integer projectId) {
        return centerLargeScreenService.getTaskStatisticsData(projectId);
    }

    @PostMapping(value = "/mastercomputer/{projectId}/{masterComputerId}", produces = "application/json;charset=UTF-8")
    public ResponseResult getMasterComputerStatisticsData(@PathVariable("projectId") Integer projectId, @PathVariable("masterComputerId") Integer masterComputerId) {
        return centerLargeScreenService.getMasterComputerStatisticsData(projectId, masterComputerId);
    }

    @PostMapping(value = "/project/{projectId}", produces = "application/json;charset=UTF-8")
    public ResponseResult getProjectStatisticsData(@PathVariable("projectId") Integer projectId) {
        return centerLargeScreenService.getProjectStatisticsData(projectId);
    }

}
